<template>
  <div class="">
    <h1>APP</h1>
    <el-button type="primary" :icon="Edit">Primary</el-button>
    <div class="name">HelloWorld999+</div>
    <svg class="svgName">
      <use xlink:href="#icon-alarmClock"></use>
    </svg>
    <svg-icon name="alarmClock" color="red" width="100px" height="100px"></svg-icon>
    <svg-icon name="alarmClock" color="blue" width="100px" height="100px"></svg-icon>

    <h2>测试 axios 二次封装</h2>
  </div>
</template>

<script setup lang="ts" name="App">
import { Edit } from "@element-plus/icons-vue";

import request from "@/utils/request";
import { onMounted } from "vue";

// 测试请求参数带有类型
import { reqLogin } from "@/api/user";

// 组件挂载完毕测试发送一个请求
onMounted(() => {
  console.log("----------");

  // request({
  //   // /dev-api/user/login :无需带有 /dev-api
  //   url: "/user/login",
  //   method: "post",
  //   data: {
  //     username: "admin",
  //     password: "111111"
  //   }
  // }).then(res => {
  //   console.log(res);
  // });

  // 测试 发送请求，参数带有类型
  reqLogin({
    username: "admin",
    password: "111111"
  });
}),
  console.log(import.meta.env);
</script>

<style lang="scss" scoped>
h1 {
  font-size: 30px;
  color: red;
}

.name {
  color: variable.$red;
}

.svgName {
  width: 30px;
  height: 30px;
}
.svgName use {
  color: yellow;
}
</style>
